<!--
 * @Author: lz08 liuzheng@ceepower.com
 * @Date: 2022-11-30 14:41:27
 * @LastEditors: lz08 liuzheng@ceepower.com
 * @LastEditTime: 2022-12-03 17:14:48
 * @FilePath: \vue3-ts-cms\src\views\login\index.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div class="min-h-screen bg-gray-100 text-gray-900 flex justify-center dlbox">
    <div class="max-w-screen-xl m-0 sm:m-20 bg-white shadow sm:rounded-lg flex justify-center flex-1">
      <div class="lg:w-1/2 xl:w-5/12 p-6 sm:p-12">
        <div class="mt-12 flex flex-col items-center">
          <h1 class="text-2xl xl:text-3xl font-extrabold">用户登录</h1>
          <div class="w-full flex-1 mt-8">
            <LzLoginType></LzLoginType>
            <LzLine :title="`或者使用平台账户登录`"></LzLine>
            <LzLogin @login="userLogin"></LzLogin>
          </div>
        </div>
      </div>
      <div class="flex-1 bg-indigo-100 text-center hidden lg:flex">
        <div class="m-12 xl:m-16 w-full bg-contain bg-center bg-no-repeat svg"></div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import Cookies from 'js-cookie'
import { defineComponent } from "vue";
import { useRouter } from "vue-router";

export default defineComponent({
  name: "login",
  setup() {
    const router = useRouter();
    const redirect = router.currentRoute.value.query.redirect || "/index";
    console.log(router,"###")
    function userLogin(userInfo : object){
      console.log(userInfo,"登陆者的信息")
      Cookies.set("system_token", "dba7da6c5cbc438e879d73bffd6d0c4a")
      let param : object = {
        path:redirect
      }
      router.push(param);
    }
    return { userLogin }
  },
});
</script>

<style lang="less">
@import url('@/css/tailwind.min.css');
.svg {
  background-image: url(@/assets/images/dlbox.svg);
}
.dlbox .weixin,
.dlbox .weibo {
  display: inline-block;
  width: 32px;
  height: 32px;
  background-size: cover;
}

.dlbox .weixin {
  background-image: url(@/assets/images/weixin.png);
}

.dlbox .weibo {
  background-image: url(@/assets/images/weibo.png);
}
.bg-indigo-100 {
  background-color: #ebf4ff;
}
.bg-gray-100 {
  background-color: #f7fafc;
}
</style>